import com.cinema.db.DatabaseManager;
import com.cinema.dao.UserDao;
import com.cinema.dao.impl.UserDaoImpl;
import com.cinema.entity.User;

public class test-db {
    public static void main(String[] args) {
        try {
            DatabaseManager dbManager = DatabaseManager.getInstance();
            UserDao userDao = new UserDaoImpl(dbManager);
            
            // 测试查询admin用户
            User admin = userDao.findById("admin");
            if (admin != null) {
                System.out.println("找到admin用户: " + admin);
            } else {
                System.out.println("admin用户不存在");
            }
            
            // 查询所有用户
            System.out.println("所有用户:");
            userDao.findAll().forEach(System.out::println);
            
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
} 